You can use the while loop to perform counting so that you can repeat a statement or block a given number of times.
This program makes the value in count one bigger each time the code in the loop is obeyed. In addition, the condition on the while will only allow it to continue if the value in count is less than our limit of 4. As the program runs the value in count gets larger until it reaches 4, at which point we have a value which is no longer less than 4, and the loop stops.
At this point the line immediately after the while is reached. Note that when we reach that end point the value in count is the limit value, in this case 4.
If we want to create a loop which will go around 50 times we just change the value in the while condition. Note that the upper limit on the number of times around the loop is set by the maximum value which an integer can hold (see the section on variable types for more detail).
The variable count is called a control variable in that it determines the loop behaviour. There is nothing to stop you changing the control variable inside a loop, but you should bear in mind that this may upset the way the loop works:
int count = 0 ; while ( count < 10 ) { /* this is very stupid */ count = 1 ; }
The above code was written by an idiot, and would never stop. This may be what the writer intended, but I don't like his style. Of course clever programmers might set the counter to a terminating value to make a loop end, but we shall see later that there is a better way of getting out of loops early.